home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / NetModem™_MNP.CCL < prev    next >
Encoding:
Text File  |  1992-09-18  |  24.0 KB  |  738 lines  |  [TEXT/MPS ]

  1. !
  2. ! NetModem™ CCL script using software MNP protocol
  3. !
  4. !    Change History-
  5. !        v1.0        09/21/90    gs:General Release Version
  6. !        v1.0.2        12/07/90    gs:Create minor release version
  7. !
  8. !    The following label ranges (0-255) are defined for all scripts:
  9. !
  10. !    Label        Function
  11. !    -----        --------
  12. !    0-19        Communications Setup
  13. !    20-39        Get a Modem (IBX switch thru)
  14. !    40-59        Modem Setup
  15. !    60-79        Dialing
  16. !    80-99        Physical Connection
  17. !    100-119        GEIS Logon
  18. !    120-139        CICS
  19. !    140-159        APPM
  20. !    160-179        Online
  21. !    180-199        Terminate Session
  22. !    200-209        Cancel
  23. !    210-219        Hangup
  24. !    230-239        <UNUSED>
  25. !    240-255        Disconnect
  26. !
  27. !    Note:        Label 210 is the modem hangup sequence
  28. !                Label 240 is reserved as the start of the disconnect sequence
  29. !
  30. !================================================================================
  31. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  32. !================================================================================
  33. !
  34. !    Select the MNPSerial Tool, initialize some parameters and open the session.
  35. !
  36. !    CTBTOOL <Toolname> [<LabelIfToolDoesn'tExist>] [<LabelIfError>] [<ctb flags>] [<buffer sizes>]
  37. CTBTool "MNPSerial Tool" 4 5
  38. !    CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
  39. CTBParameter MNPAutoEngage On 6
  40. CTBParameter MNPAutoengageString "CONNECT ~Baud\13" 7
  41. CTBParameter MNPConnectionMode Initiator 8
  42. CTBParameter MNPAutoEngageDelay 30 9
  43. CTBParameter MNPConnectAtOpen No 10
  44. CTBParameter MNPCloseConnectionIfMNPFails Yes 11
  45. CTBParameter Baud ~Baud 12
  46. CTBParameter Port "~MPrt" 13
  47. !    Dont set Data, Stop, or Parity bits for S/W MNP (defaults to 8,1,0 in the tool)
  48. !
  49. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  50. CTBOpen 14 15        ! Open the Communications session
  51. !
  52. !    Flush any data, Initialize script variables and define Cancel label
  53. Flush                ! clear input buffer and ring buffer
  54. CanBtn 200            ! If user cancels, take the error return
  55. !
  56. SetVar 1 0            ! #of consecutive no responses to hangup command
  57. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  58. SetVar 3 0            ! #of consecutive network contact failures.
  59. SetVar 4 0            ! #of logon validation failures
  60. SetVar 5 0            ! #of consecutive CICS90  failures
  61. SetVar 6 0            ! #of consecutive APPM failures
  62. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  63. SetVar 8 0            ! not used
  64. !
  65. Jump 20                ! Go to Modem Selection and Setup
  66. !
  67. !*********
  68. -LABEL 4    !---<MNPSerial Tool missing>---
  69. !*********
  70. Alert -1 The MNP Serial tool cannot be found in your System folder.\13Please install it, and try again.
  71. Exit -1                ! exit the script with an error
  72. !
  73. !*********
  74. -LABEL 5    !---<CTBTool Comm Toolbox err>---
  75. !*********
  76. Alert -1 A CTBTool error has occurred in the Communications Toolbox.\13Please try again.\13If the problem continues, call the Apple USA helpline.
  77. Exit -1                ! exit the script with an error.
  78. !
  79. !*********
  80. -LABEL 6    !---<CTBParameter MNPAutoengage failed>---
  81. !*********
  82. Alert -1 CTBParameter MNPAutoengage caused an error.
  83. Exit -1                ! exit the script with an error.
  84. !
  85. !*********
  86. -LABEL 7    !---<CTBParameter MNPAutoengageString failed>---
  87. !*********
  88. Alert -1 CTBParameter MNPAutoengageString caused an error.
  89. Exit -1                ! exit the script with an error.
  90. !
  91. !*********
  92. -LABEL 8    !---<CTBParameter MNPConnectionMode failed>---
  93. !*********
  94. Alert -1 CTBParameter MNPConnectionMode caused an error.
  95. Exit -1                ! exit the script with an error.
  96. !
  97. !*********
  98. -LABEL 9    !---<CTBParameter MNPAutoEngageDelay failed>---
  99. !*********
  100. Alert -1 CTBParameter MNPAutoEngageDelay caused an error.
  101. Exit -1                ! exit the script with an error.
  102. !
  103. !*********
  104. -LABEL 10    !---<CTBParameter MNPConnectAtOpen failed>---
  105. !*********
  106. Alert -1 CTBParameter MNPConnectAtOpen caused an error.
  107. Exit -1                ! exit the script with an error.
  108. !
  109. !*********
  110. -LABEL 11    !---<CTBParameter MNPCloseConnectionIfMNPFails failed>---
  111. !*********
  112. Alert -1 CTBParameter MNPCloseConnectionIfMNPFails caused an error.
  113. Exit -1                ! exit the script with an error.
  114. !
  115. !*********
  116. -LABEL 12    !---<CTBParameter Baud failed>---
  117. !*********
  118. Alert -1 CTBParameter Baud caused an error.
  119. Exit -1                ! exit the script with an error.
  120. !
  121. !*********
  122. -LABEL 13    !---<CTBParameter Port failed>---
  123. !*********
  124. Alert -1 CTBParameter Port caused an error.
  125. Exit -1                ! exit the script with an error.
  126. !
  127. !*********
  128. -LABEL 14    !---<CTBOpen failed>---
  129. !*********
  130. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  131. Exit -1                ! exit the script with an error.
  132. !
  133. !**********
  134. -LABEL 15    !---<CTBOpen err>---
  135. !**********
  136. Alert -1 CTBOpen caused an Communications Toolbox error.
  137. Exit -1                ! exit the script with an error.
  138. !
  139. !================================================================================
  140. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  141. !================================================================================
  142. !
  143. !================================================================================
  144. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  145. !================================================================================
  146. DsplyPic 1
  147. DsplyMsg Making sure the modem is ready.
  148. !    No need to hangup when coming into the script
  149. SetVar 1 0            ! clear # hangup tries counter
  150. !
  151. !**********
  152. -LABEL 42    ! ---<Got modem attention>---
  153. !**********
  154. DsplyMsg Setting modem parameters.
  155. !    Clear all previous MatchStr's and setup the modem
  156. MatchStr 1 42 Dummy
  157. Wait 30                ! Give modem .5 second to get ready before sending the attention chars
  158. Xmit AT
  159. !    Send NetModem™ commands
  160. Wait 3                ! Pause before "turn off the command echo" command
  161. Xmit E0
  162. Wait 3                ! Pause before "verbal result messages" command
  163. Xmit V1
  164. Wait 3                ! Pause before "select all result codes" command
  165. Xmit X1
  166. Wait 3
  167. Flush                ! clear input buffer and send Carriage Return (CR)
  168. Xmit \13
  169. !
  170. !    Look for one of the following expected responses
  171. MatchStr 1 60 OK
  172. Wait 180               ! wait 3 secs
  173. IncVar 2            ! increment # modem setup tries
  174. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  175. DsplyMsg Modem does not respond to setup commands. Retrying ...
  176. Jump 42                ! else try modem setup again
  177. !
  178. !**********
  179. -LABEL 44    ! ---<Modem configuration err>---
  180. !**********
  181. Bell
  182. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  183. SetVar 2 0            ! clear # modem setup tries
  184. Jump 40                ! reset modem and try again
  185. !
  186. !================================================================================
  187. -LABEL 60    !***<Modem ready>*** Dial phone
  188. !================================================================================
  189. DsplyMsg Dialing ~Fone ...
  190. DsplyPic 2
  191. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  192. MatchStr 1 60 Dummy
  193. SetVar 2 0            ! clear #modem setup tries
  194. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  195. Xmit AT
  196. Wait 3                ! Pause before "tone dial" command
  197. Xmit D~Tone
  198. Wait 3                ! Pause before phone number
  199. Xmit ~Fone
  200. Wait 3
  201. Flush                ! clear input buffer and send CR
  202. Xmit \13
  203. !
  204. !    Look for one of the following expected responses
  205. MatchStr 1 80 ~Baud\13
  206. MatchStr 2 66 CARRIER
  207. MatchStr 3 70 BUSY
  208. MatchStr 4 74 NO DIAL
  209. MatchStr 5 62 ERROR
  210. MatchStr 6 80 1200\13
  211. MatchStr 7 80 2400\13
  212. MatchStr 8 80 4800\13
  213. MatchStr 9 80 9600\13
  214. Wait 2100            ! wait 35 secs
  215. !
  216. !**********
  217. -LABEL 62    !---<No response or ERROR from modem>---
  218. !**********
  219. IncVar 3            ! Increment # dial attempts counter
  220. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  221. DsplyMsg Modem does not respond to Dial command. Retrying ...
  222. Jump 40                ! reset modem and try again
  223. !
  224. !**********
  225. -LABEL 64    !---<No dial response err>---
  226. !**********
  227. Bell
  228. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  229. SetVar 3 0            ! clear # dial attempts counter
  230. Jump 40                ! reset modem and try again
  231. !
  232. !**********
  233. -LABEL 66   !---<No Carrier>---
  234. !**********
  235. IncVar 3            ! Increment # dial attempts counter
  236. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  237. DsplyMsg No Carrier with phone number dialed. Retrying ...
  238. Jump 40                ! reset modem and try again
  239. !
  240. !**********
  241. -LABEL 68    !---<No carrier err>---
  242. !**********
  243. Bell
  244. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  245. SetVar 3 0            ! clear # dial attempts counter
  246. Jump 40                ! reset modem and try again
  247. !
  248. !**********
  249. -LABEL 70    !---<busy>---
  250. !**********
  251. IncVar 3            ! Increment # dial attempts counter
  252. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  253. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  254. Wait 300            ! wait 5 secs
  255. DsplyMsg Phone number dialed is busy. Retrying ....
  256. Jump 40                ! reset modem and try again
  257. !
  258. !**********
  259. -LABEL 72    !---<Busy err>---
  260. !**********
  261. Bell
  262. Alert 200 All network access lines are in use.\13Try again later.
  263. SetVar 3 0            ! clear # dial attempts counter
  264. Jump 40                ! reset modem and try again
  265. !
  266. !**********
  267. -LABEL 74    !---<No Dialtone>---
  268. !**********
  269. IncVar 3            ! Increment # dial attempts counter
  270. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  271. DsplyMsg Modem reports no dial tone. Retrying ...
  272. Jump 40                ! reset modem and try again
  273. !
  274. !**********
  275. -LABEL 76   !---<No dialtone Error>---
  276. !**********
  277. Bell
  278. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  279. SetVar 3 0            ! clear # dial attempts counter
  280. Jump 40                ! reset modem and try again
  281. !
  282. !================================================================================
  283. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  284. !================================================================================
  285. DsplyMsg Requesting network attention
  286. !    Look for one of the following expected responses
  287. MatchStr 1 84 NO CARRIER
  288. MatchStr 2 100 U#
  289. Wait 12                ! Wait 0.2 sec before sending the first H
  290. Xmit H
  291. Wait 21                ! Wait another 0.35 sec before sending the second H
  292. Xmit H
  293. Wait 600            ! Allow 10 seconds for the U# to show up
  294. IncVar 3            ! No U#, increment # dial attempts counter
  295. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  296. DsplyMsg Unable to get network attention. Retrying ...
  297. Jump 40                ! reset modem and try again
  298. !
  299. !**********
  300. -LABEL 82    !---<No U#>---
  301. !**********
  302. Bell
  303. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  304. SetVar 3 0            ! clear # dial attempts counter
  305. Jump 40                ! reset modem and try again
  306. !
  307. !**********
  308. -LABEL 84    !---<Line dropped>---
  309. !**********
  310. IncVar 3            ! Increment # dial attempts counter
  311. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  312. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  313. Jump 40                ! reset modem and try again
  314. !
  315. !**********
  316. -LABEL 86   !---<Line dropped Err>---
  317. !**********
  318. Bell
  319. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  320. SetVar 3 0            ! clear # dial attempts counter
  321. Jump 40                ! reset modem and try again
  322. !
  323. !================================================================================
  324. -LABEL 100    !***<GEIS logon>***
  325. !================================================================================
  326. !
  327. DsplyMsg Physical Connection established. Logging on to network ...
  328. DsplyPic 3
  329. SetVar 3 0            ! clear # dial attempts counter
  330. Wait 6                ! wait 0.1 sec
  331. Flush                ! clear input buffer
  332. !    Note: leave 2 spaces between ~Dist and ~Numb
  333. Xmit ~User,~Dist  ~Numb,~Ridn\13
  334. !
  335. !    Look for one of the following expected responses
  336. MatchStr 1 104 NO CARRIER
  337. MatchStr 2 106 DISCONNECTED
  338. MatchStr 3 120 ===>
  339. MatchStr 6 108 N FAULT,
  340. MatchStr 7 108 T FORMAT,
  341. MatchStr 8 110 L DENIED
  342. MatchStr 9 112 BUSY
  343. MatchStr 10 112 DOWN
  344. Wait 4200            ! wait up to 70 seconds for a response
  345. IncVar 4            ! Increment # logon attempts counter
  346. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  347. DsplyMsg No logon response from network. Retrying ...
  348. Jump 40                ! reset modem and try again
  349. !
  350. !*********
  351. -LABEL 102    !---<No Logon response>---
  352. !*********
  353. Bell
  354. Alert 200 No logon response from network.\13Try again.
  355. SetVar 4 0            ! clear # logon attempts counter
  356. Jump 40                ! reset modem and try again
  357. !
  358. !*********
  359. -LABEL 104    !---<Carrier dropped>---
  360. !*********
  361. IncVar 4            ! Increment # login attempts counter
  362. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  363. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  364. Jump 40                ! reset modem and try again
  365. !
  366. !*********
  367. -LABEL 105    !---<Carrier dropped Err>---
  368. !*********
  369. Bell
  370. Alert 200 Carrier signal dropped during network logon.\13Try again.
  371. SetVar 4 0            ! clear # logon attempts counter
  372. Jump 40                ! reset modem and try again
  373. !
  374. !*********
  375. -LABEL 106    !---<Session disconnected>---
  376. !*********
  377. IncVar 4            ! Increment # logon attempts counter
  378. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  379. DsplyMsg Network connection dropped during network logon. Retrying ...
  380. Jump 40                ! reset modem and try again
  381. !
  382. !*********
  383. -LABEL 107    !---<Session disconnected Err>---
  384. !*********
  385. Bell
  386. Alert 200 Network connection dropped during network logon.\13Try again.
  387. SetVar 4 0            ! clear # logon attempts counter
  388. Jump 40                ! reset modem and try again
  389. !
  390. !*********
  391. -LABEL 108    !---<Validation fault>---
  392. !*********
  393. IncVar 4            ! Increment # logon attempts counter
  394. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  395. DsplyMsg Network rejected your identification. Retrying ...
  396. Wait 60                ! wait 1 sec
  397. Jump 100            ! retry GEIS login (only case where we don't reset)
  398. !
  399. !*********
  400. -LABEL 109    !---<validation fault err>---
  401. !*********
  402. Bell
  403. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  404. SetVar 4 0            ! clear # logon attempts counter
  405. Jump 40                ! reset modem and try again
  406. !
  407. !*********
  408. -LABEL 110    !---<Denied by host>---
  409. !*********
  410. IncVar 4            ! Increment # logon attempts counter
  411. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  412. DsplyMsg Network host equipment problem detected. Retrying ...
  413. Jump 40                ! reset modem and try again
  414. !
  415. !*********
  416. -LABEL 111    !---<Denied by host err>---
  417. !*********
  418. Bell
  419. Alert 200 Network host equipment problem detected.\13Try again.
  420. SetVar 4 0            ! clear # logon attempts counter
  421. Jump 40                ! reset modem and try again
  422. !
  423. !*********
  424. -LABEL 112    !---<MARK3K access busy/down>---
  425. !*********
  426. IncVar 4            ! Increment # logon attempts counter
  427. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  428. DsplyMsg Network equipment busy/down. Retrying ...
  429. Jump 40                ! reset modem and try again
  430. !
  431. !*********
  432. -LABEL 113    !---<MARK3K access busy/down err>---
  433. !*********
  434. Bell
  435. Alert 200 Network equipment busy or down.\13Try again.
  436. SetVar 4 0            ! clear # logon attempts counter
  437. Jump 40                ! reset modem and try again
  438. !
  439. !================================================================================
  440. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  441. !================================================================================
  442. !
  443. DsplyMsg Requesting access to network subsystem ...
  444. DsplyPic 4
  445. Wait 6                ! wait 0.1 secs
  446. Flush                ! clear input buffer
  447. !
  448. Xmit ~CICS\13
  449. !    Look for one of the following expected responses
  450. MatchStr 3 140 READY
  451. !    To overcome a network problem, the following label was changed from 124 to 126
  452. !    MatchStr 4 124 T BOUND
  453. MatchStr 4 126 T BOUND
  454. MatchStr 5 126 UNRECOGN
  455. MatchStr 6 126 ===>
  456. Wait 3600            ! Allow 60 secs for the expected responses to show up
  457. IncVar 5            ! Timeout, so increment # CICS tries counter
  458. IfVar 5 2 122        ! if 3 tries, display No Response alert
  459. DsplyMsg No response to network subsystem request. Retrying ...
  460. Jump 40                ! reset modem and try again
  461. !
  462. !*********
  463. -LABEL 122    !---<No CICS err>---
  464. !*********
  465. Bell
  466. Alert 200 No response to network subsystem request.\13Try again.
  467. SetVar 5 0            ! clear # CICS tries counter
  468. Jump 40                ! reset modem and try again
  469. !
  470. !*********
  471. -LABEL 124    !---<Session not bound err>---
  472. !*********
  473. Bell
  474. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  475. Jump 200            ! jump to cancel routine
  476. !
  477. !*********
  478. -LABEL 126    !---<Invalid application>---
  479. !*********
  480. IncVar 5            ! Increment # CICS tries counter
  481. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  482. DsplyMsg Network subsystem request has been rejected. Retrying ...
  483. Wait 60                ! wait 1 sec
  484. Flush
  485. Jump 120            ! try to access CICS again
  486. !
  487. !*********
  488. -LABEL 127    !---<Invalid application err>---
  489. !*********
  490. Bell
  491. Alert 200 The network subsystem request has been rejected.\13Try again.
  492. SetVar 5 0            ! clear # CICS tries counter
  493. Flush
  494. Jump 40                ! reset modem and try again
  495. !
  496. !================================================================================
  497. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  498. !================================================================================
  499. !
  500. DsplyMsg Requesting access to distribution center ~Dist ...
  501. DsplyPic 5            ! Highlight box 5 on screen
  502. SetVar 5 0            ! clear # CICS tries counter
  503. !                    ! Send what needs to be sent
  504. Xmit ~Epgm~Dist\13
  505. !    Look for one of the following expected responses
  506. Wait 12                ! wait 0.2 secs
  507. Flush                ! clear input buffer
  508. !    Look for one of the following expected responses
  509. MatchStr 3 160 C100
  510. MatchStr 4 144 INVALID
  511. Wait 3600            ! Allow 60 secs for the expected responses to show up
  512. !
  513. IncVar 6            ! Timeout, so Increment # APPM tries counter
  514. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  515. DsplyMsg No response to distribution center access request. Retrying ...
  516. Jump 40                ! reset modem and try again
  517. !
  518. !*********
  519. -LABEL 142    !---<No transaction response>---
  520. !*********
  521. Bell
  522. Alert 200 No response to distribution center access.\13Try again.
  523. SetVar 6 0            ! reset # APPM tries counter
  524. Jump 40                ! reset modem and try again
  525. !
  526. !*********
  527. -LABEL 144    !---<Invalid transaction>---
  528. !*********
  529. IncVar 6            ! Increment # APPM tries counter
  530. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  531. DsplyMsg Distribution center access request rejected. Retrying ...
  532. Jump 40                ! reset modem and try again
  533. !
  534. !*********
  535. -LABEL 145    !---<Invalid transaction err>---
  536. !*********
  537. Bell
  538. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  539. SetVar 6 0            ! reset # APPM tries counter
  540. Jump 40                ! reset modem and try again
  541. !
  542. !================================================================================
  543. -LABEL 160    !***<Online>***
  544. !================================================================================
  545. !
  546. Wait 60                ! wait 1 sec
  547. DsplyMsg Accessing the distribution center ~Dist ...
  548. DsplyPic 6            ! Highlight box 6 on screen
  549. !    C9 = pass msg thru GE, 899 = Echo cmd
  550. Xmit C9899Ole\13
  551. !    Look for one of the following expected responses
  552. MatchStr 2 162 C5
  553. MatchStr 3 164 Ole\13
  554. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  555. !
  556. !*********
  557. -LABEL 162    !---<no luck this time>--- 
  558. !*********
  559. DsplyMsg Distribution center is not available ...
  560. Jsr 180                ! terminate session
  561. Bell
  562. Alert -1 Distribution center is not available.\13Please try again later.
  563. Jump 200            ! exit to Cancel routine
  564. !
  565. !*********
  566. -LABEL 164    !---<Success, but did MNP sync up?>--- 
  567. !*********
  568. !
  569. !    CTBCHECKPARAMETER <ParameterName> <ValueToCheckAgainst>
  570. !                      <LabelIfMatch> [<LabelIfParameterNotFound>] [<LabelIfError>]
  571. CTBCheckParameter MNPStatus On 170 168 169
  572. CTBCheckParameter MNPStatus Off 165 168 169
  573. CTBCheckParameter MNPStatus Connecting 166 168 169
  574. CTBCheckParameter MNPStatus Disconnecting 167 168 169
  575. !
  576. DisplyMsg Error in Communications
  577. Jsr 180                ! terminate session
  578. Bell
  579. Alert -1 Warning: The MNP Status is unknown.\13The session has been terminated.
  580. Jump 200            ! exit to Cancel routine
  581. !
  582. !*********
  583. -LABEL 165    !---<MNP Status was Off>---
  584. !*********
  585. DisplyMsg Error in Communications
  586. Jsr 180                ! terminate session
  587. Bell
  588. Alert -1 Warning: The MNP Status is Off.\13The session has been terminated.
  589. Jump 200            ! exit to Cancel routine
  590. !
  591. !*********
  592. -LABEL 166    !---<MNP Status was Connecting>---
  593. !*********
  594. DisplyMsg Error in Communications
  595. Jsr 180                ! terminate session
  596. Bell
  597. Alert -1 Warning: The MNP Status is Connecting.\13The session has been terminated.
  598. Jump 200            ! exit to Cancel routine
  599. !
  600. !*********
  601. -LABEL 167    !---<MNP Status was Disconnecting>---
  602. !*********
  603. DisplyMsg Error in Communications
  604. Jsr 180                ! terminate session
  605. Bell
  606. Alert -1 Warning: The MNP Status is Disconnecting.\13The session has been terminated.
  607. Jump 200            ! exit to Cancel routine
  608. !
  609. !*********
  610. -LABEL 168    !---<MNP Status was not recognized>---
  611. !*********
  612. DisplyMsg Error in Communications
  613. Jsr 180                ! terminate session
  614. Bell
  615. Alert -1 MNPStatus was not recognized as a valid parameter.\13Call the Apple USA HelpLine.
  616. Jump 200            ! exit to Cancel routine
  617. !
  618. !*********
  619. -LABEL 169    !---<CTBCheckParameter error>---
  620. !*********
  621. DisplyMsg Error in Communications
  622. Jsr 180                ! terminate session
  623. Bell
  624. Alert -1 An error occurred in the CTBCheckParameter function.\13Call the Apple USA HelpLine.
  625. Jump 200            ! exit to Cancel routine
  626. !
  627. !*********
  628. -LABEL 170    !---<Success, we’re in, so exit>--- 
  629. !*********
  630. Wait 30                ! wait 0.5 secs
  631. Flush                ! clear input buffer
  632. Exit 0                ! exit the script normally
  633. !
  634. !================================================================================
  635. -LABEL 180-199    !***<Terminate Session>***
  636. !================================================================================
  637. !
  638. !*********
  639. -LABEL 180    !---<Terminate session>--- 
  640. !*********
  641. !    send Abnormal disconnect command
  642. Xmit C3\13
  643. !    Look for one of the following expected responses
  644. MatchStr 1 182 U#
  645. Wait 300            ! wait 5 secs
  646. Return
  647. !
  648. !*********
  649. -LABEL 182    !---<Say bye>---
  650. !*********
  651. Wait 6                ! wait 0.1 sec and sign off the network
  652. Xmit BYE\13
  653. Return
  654. !
  655. !================================================================================
  656. -LABEL 200    !***<Cancel Routine>***
  657. !================================================================================
  658. DsplyMsg Canceling ...
  659. Flush
  660. Wait 30                ! wait 0.5 secs
  661. Exit -1                ! exit the script with an error
  662. !
  663. !================================================================================
  664. -LABEL 210    !***<Hang up phone Routine>***
  665. !================================================================================
  666. !
  667. !    Look for one of the following expected responses
  668. MatchStr 1 222 CARRIER
  669. SetVar 1 0            ! clear # hangup tries counter
  670. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  671. ! If MNP is on, turn it off first or the modem will not understand the Hangup command
  672. !
  673. !    CTBCHECKPARAMETER <ParameterName> <ValueToCheckAgainst>
  674. !                      <LabelIfMatch> [<LabelIfParameterNotFound>] [<LabelIfError>]
  675. CTBCheckParameter MNPStatus Off 220 168 169            
  676. CTBCheckParameter MNPStatus Connecting 212 168 169
  677. CTBCheckParameter MNPStatus Disconnecting 213 168 169        
  678. !    CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
  679. CTBParameter MNPStatus Off 215        ! MNP was on, so turn it off
  680. !    Check it again, just in case
  681. CTBCheckParameter MNPStatus Off 220 168 169
  682. Jump 220            ! MNP turned off OK, so finish hanging up
  683. !
  684. !*********
  685. -LABEL 212    !---<MNPStatus is Connecting>---
  686. !*********
  687. IncVar 2            ! Increment # MNPstatus checks counter
  688. IfVar 2 3 214        ! if 3 checks, display alert and exit script with error
  689. Alert 200 MNPStatus is Connecting.
  690. Wait 30                ! wait 0.5 secs
  691. Jump 210            ! try to hang up again
  692. !
  693. !*********
  694. -LABEL 213    !---<MNPStatus is Disconnecting>---
  695. !*********
  696. IncVar 2            ! Increment # MNPstatus checks counter
  697. IfVar 2 3 214        ! if 3 checks, display alert and exit script with error
  698. Alert 200 MNPStatus is Disconnecting.
  699. Wait 30                ! wait 0.5 secs
  700. Jump 210            ! try to hang up again
  701. !
  702. !*********
  703. -LABEL 214    !---<MNPStatus is Connecting or Disconnecting>---
  704. !*********
  705. Alert 200 MNPStatus is still Connecting or Disconnecting.\13Script exiting with an error.
  706. Exit -1                ! exit the script with an error
  707. !
  708. !*********
  709. -LABEL 215    !---<CTBParameter Error>---    
  710. !*********
  711. Alert 200 CTBParameter MNPStatus Off caused an error.\13Call the Apple USA HelpLine.
  712. Exit -1                ! exit the script with an error
  713. !
  714. !*********
  715. -LABEL 220    !---<Hang up the phone subroutine>---
  716. !*********
  717. !    Close, (pause), then reopen the connection - the NetModem™ will hangup
  718. !
  719. CTBClose
  720. Wait 60
  721. CTBOpen
  722. Return
  723. !
  724. !================================================================================
  725. -LABEL 230-239    !***<UNUSED>***
  726. !================================================================================
  727. !
  728. !================================================================================
  729. -LABEL 240    !***<Disconnection Sequence>***
  730. !================================================================================
  731. !
  732. !    Just flush and exit, the connection will automatically close,
  733. !    and NetModem™ will hangup the line.
  734. !
  735. Flush                ! clear input buffer
  736. Exit 0                ! exit the script normally
  737. ###
  738.